/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package java_project;
import javax.swing.*;
import java.util.*;
import JavaSource.*;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Siqi Kang
 */
public class ManagerGUI extends javax.swing.JFrame {

    /**
     * Creates new form ManagerGUI
     */
    
    
    
    public ManagerGUI(){
        initComponents();
        this.setLocationRelativeTo( null );
    }
    
    public ManagerGUI(FoodOrderingSystem fos, Employee emp) {
        this.fos = fos;
        this.emp = emp;
        initComponents();
        this.setLocationRelativeTo( null );
        String name = emp.getName();
        int id = emp.getEmployeeId();
        String pos = emp.getPosition();
        employeeName.setText(name);
        employeeId.setText(Integer.toString(id));
        employeePosition.setText(pos);      
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    
    public void clearTable(JTable table){
        DefaultTableModel model = (DefaultTableModel)table.getModel();
        for (int index = model.getRowCount() - 1; index >= 0; index--) {
            model.removeRow(index);
        }
    }
    
     public void showAllEmployee(){
        position = jTable2.getColumnModel().getColumn(2);  
        JComboBox comboBox = new JComboBox();
        comboBox.addItem("Cook");
        comboBox.addItem("Front Desk");
        comboBox.addItem("Delivery Man");
        comboBox.addItem("Manager"); 
        position.setCellEditor(new DefaultCellEditor(comboBox));   
        empList1.clear();
        try {
          empList = fos.getEmployeeList();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(ManagerGUI.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException | ClassNotFoundException ex) {
            Logger.getLogger(ManagerGUI.class.getName()).log(Level.SEVERE, null, ex);
        }
        DefaultTableModel m = (DefaultTableModel)(jTable2.getModel());
        m.setRowCount(0);
        for(int i=0; i < empList.size(); i++){
            Employee e = empList.get(i);
            empList1.add(e);
            Object ob[] = {e.getEmployeeId(), e.getName(),e.getPosition()};
            m.addRow(ob);           
        }
    }
    
    public void showAllCoupon(){
        cpList = fos.getCouponList();
        DefaultTableModel m = (DefaultTableModel)(jTable3.getModel());
        m.setRowCount(0);
        for(int i = 0; i < cpList.size(); i++){
            Coupon c = cpList.get(i);
            Object ob[] = {c.getCouponID(), c.getCouponCode(),c.getBeginTime(), c.getExpirationTime(), c.getRate()};
            m.addRow(ob);
        }        
    }
    
    public void showAllDish(){
        dishList1.clear();
        dishList = fos.getDishList();
        DefaultTableModel m = (DefaultTableModel)(jTable4.getModel());
        m.setRowCount(0);
        for(int i = 0; i < dishList.size(); i++){
            Dish d = dishList.get(i);
            dishList1.add(d);
            Object ob[] = {d.getDishId(), d.getName(), d.readPrice()};
            m.addRow(ob);
        }
    }
    
    public void showAllIngredient(){
        ingList = fos.getIngredientList();
        DefaultTableModel m = (DefaultTableModel)(jTable5.getModel());
        m.setRowCount(0);
        for(int i = 0; i < ingList.size(); i++){
            Ingredient ing = ingList.get(i);
            Object ob[] = {ing.getIngredientId(),ing.getName(),ing.getQuantity(),ing.getThreshold()};
            m.addRow(ob);
        }        
    }
    
    public Object getSelectedObject(JTable table, LinkedList list){
        int index = table.getSelectedRow();
        Object o = list.get(index);
        return o;
    }
    
    public void refreshTable(JTable table, LinkedList list){
      // table.removeAll();
       clearTable(table);
       DefaultTableModel m = (DefaultTableModel)(table.getModel());
       m.setRowCount(0);
       for(int i =0; i < list.size(); i++){            
           Object o = list.get(i);
           if(o instanceof Employee){
               Employee e = (Employee)o;
               Object ob[] = {e.getEmployeeId(), e.getName(),e.getPosition()};
               m.addRow(ob);               
           } 
           else if(o instanceof Dish){
               Dish d = (Dish)o;
               Object ob[] = {d.getDishId(),d.getName(),d.readPrice()};
               m.addRow(ob);
           }
           else{
               
           }
       }         
   }
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        employeeNameLbl = new javax.swing.JLabel();
        employeeIdLbl = new javax.swing.JLabel();
        positionLbl = new javax.swing.JLabel();
        employeeName = new javax.swing.JLabel();
        employeeId = new javax.swing.JLabel();
        employeePosition = new javax.swing.JLabel();
        managerTab = new javax.swing.JTabbedPane();
        hRManagementTab = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        empIdInput = new javax.swing.JTextField();
        searchButton = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        addEmployee = new javax.swing.JButton();
        remove = new javax.swing.JButton();
        detailButton = new javax.swing.JButton();
        Change2 = new javax.swing.JButton();
        addCouponTab = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        employeeIdLbl1 = new javax.swing.JLabel();
        addCoupon = new javax.swing.JButton();
        modifyMenuTab = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        dishNameInput = new javax.swing.JTextField();
        searchButton1 = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable4 = new javax.swing.JTable();
        detailButton1 = new javax.swing.JButton();
        remove1 = new javax.swing.JButton();
        addDish = new javax.swing.JButton();
        modifyIngredients = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTable5 = new javax.swing.JTable();
        jPanel4 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        ingredientName = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        ingredientQuantity = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        threshold = new javax.swing.JTextField();
        Update = new javax.swing.JButton();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        employeeNameLbl.setFont(new java.awt.Font("Times New Roman", 1, 16)); // NOI18N
        employeeNameLbl.setText("Employee Name:");
        employeeNameLbl.setName(""); // NOI18N

        employeeIdLbl.setFont(new java.awt.Font("Times New Roman", 1, 16)); // NOI18N
        employeeIdLbl.setText("Employee ID:");

        positionLbl.setFont(new java.awt.Font("Times New Roman", 1, 16)); // NOI18N
        positionLbl.setText("Position:");

        employeeName.setFont(new java.awt.Font("宋体", 0, 14)); // NOI18N
        employeeName.setText("Tom Doe");

        employeeId.setFont(new java.awt.Font("宋体", 0, 14)); // NOI18N
        employeeId.setText("1234-4321");

        employeePosition.setFont(new java.awt.Font("宋体", 0, 14)); // NOI18N
        employeePosition.setText("Manager");

        managerTab.setFont(new java.awt.Font("Times New Roman", 1, 16)); // NOI18N
        managerTab.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                managerTabStateChanged(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        jLabel1.setText("Employee ID:");

        empIdInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                empIdInputActionPerformed(evt);
            }
        });

        searchButton.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        searchButton.setText("Search");
        searchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(74, 74, 74)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(105, 105, 105)
                .addComponent(empIdInput, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(122, 122, 122)
                .addComponent(searchButton, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(empIdInput, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(searchButton)))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        jTable2.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Employee ID", "Name", "Position"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(jTable2);

        addEmployee.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        addEmployee.setText("Add Employee");
        addEmployee.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addEmployeeActionPerformed(evt);
            }
        });

        remove.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        remove.setText("Remove");
        remove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeActionPerformed(evt);
            }
        });

        detailButton.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        detailButton.setText("Show Detail");
        detailButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                detailButtonActionPerformed(evt);
            }
        });

        Change2.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        Change2.setText("Update");
        Change2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Change2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout hRManagementTabLayout = new javax.swing.GroupLayout(hRManagementTab);
        hRManagementTab.setLayout(hRManagementTabLayout);
        hRManagementTabLayout.setHorizontalGroup(
            hRManagementTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane2)
            .addGroup(hRManagementTabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(Change2, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(70, 70, 70)
                .addComponent(detailButton, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 73, Short.MAX_VALUE)
                .addComponent(remove, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(67, 67, 67)
                .addComponent(addEmployee, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        hRManagementTabLayout.setVerticalGroup(
            hRManagementTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hRManagementTabLayout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(39, 39, 39)
                .addGroup(hRManagementTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(hRManagementTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(Change2)
                        .addComponent(detailButton))
                    .addGroup(hRManagementTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(addEmployee)
                        .addComponent(remove)))
                .addContainerGap(38, Short.MAX_VALUE))
        );

        managerTab.addTab("HR Management", hRManagementTab);

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "CouponID", "Coupon Code", "Begin Date", "Expiration Date", "Coupon Rate"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(jTable3);

        employeeIdLbl1.setFont(new java.awt.Font("Times New Roman", 1, 16)); // NOI18N
        employeeIdLbl1.setText("Existing Coupon:");

        addCoupon.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        addCoupon.setText("Add New Coupon");
        addCoupon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addCouponActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout addCouponTabLayout = new javax.swing.GroupLayout(addCouponTab);
        addCouponTab.setLayout(addCouponTabLayout);
        addCouponTabLayout.setHorizontalGroup(
            addCouponTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3)
            .addGroup(addCouponTabLayout.createSequentialGroup()
                .addGroup(addCouponTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(addCouponTabLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(employeeIdLbl1))
                    .addGroup(addCouponTabLayout.createSequentialGroup()
                        .addGap(311, 311, 311)
                        .addComponent(addCoupon, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(333, Short.MAX_VALUE))
        );
        addCouponTabLayout.setVerticalGroup(
            addCouponTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(addCouponTabLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(employeeIdLbl1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(39, 39, 39)
                .addComponent(addCoupon)
                .addGap(65, 65, 65))
        );

        managerTab.addTab("Add Coupon", addCouponTab);

        jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        jLabel4.setText("Dish Name:");

        searchButton1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        searchButton1.setText("Search");
        searchButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchButton1ActionPerformed(evt);
            }
        });

        jTable4.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Dish ID", "Dish Name", "Dish Price"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane4.setViewportView(jTable4);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(63, 63, 63)
                .addComponent(dishNameInput, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(82, 82, 82)
                .addComponent(searchButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dishNameInput, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchButton1))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        detailButton1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        detailButton1.setText("Show Detail");
        detailButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                detailButton1ActionPerformed(evt);
            }
        });

        remove1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        remove1.setText("Remove");
        remove1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                remove1ActionPerformed(evt);
            }
        });

        addDish.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        addDish.setText("Add Dish");
        addDish.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addDishActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout modifyMenuTabLayout = new javax.swing.GroupLayout(modifyMenuTab);
        modifyMenuTab.setLayout(modifyMenuTabLayout);
        modifyMenuTabLayout.setHorizontalGroup(
            modifyMenuTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, modifyMenuTabLayout.createSequentialGroup()
                .addGap(59, 59, 59)
                .addComponent(detailButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 102, Short.MAX_VALUE)
                .addComponent(remove1, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(142, 142, 142)
                .addComponent(addDish, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(65, 65, 65))
        );
        modifyMenuTabLayout.setVerticalGroup(
            modifyMenuTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(modifyMenuTabLayout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(45, 45, 45)
                .addGroup(modifyMenuTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(detailButton1)
                    .addComponent(remove1)
                    .addComponent(addDish))
                .addContainerGap(61, Short.MAX_VALUE))
        );

        managerTab.addTab("Modify Menu", modifyMenuTab);

        jTable5.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID", "Name", "Quantity", "Threshold"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, true, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane5.setViewportView(jTable5);

        jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 16)); // NOI18N
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setText("Add Ingredient");

        jLabel6.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N
        jLabel6.setText("Ingredient Name: ");

        ingredientName.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N

        jLabel7.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N
        jLabel7.setText("Ingredient Quantity:");

        ingredientQuantity.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N

        jLabel8.setFont(new java.awt.Font("宋体", 1, 14)); // NOI18N
        jLabel8.setText("Threshold:");

        jButton1.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jButton1.setText("ADD");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        threshold.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(ingredientName, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                            .addComponent(ingredientQuantity)
                            .addComponent(threshold, javax.swing.GroupLayout.Alignment.TRAILING)))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(93, 93, 93)
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(133, 133, 133)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(45, 45, 45)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(threshold, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(ingredientName, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(ingredientQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 78, Short.MAX_VALUE)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(32, 32, 32))
        );

        Update.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        Update.setText("Update");
        Update.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                UpdateActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout modifyIngredientsLayout = new javax.swing.GroupLayout(modifyIngredients);
        modifyIngredients.setLayout(modifyIngredientsLayout);
        modifyIngredientsLayout.setHorizontalGroup(
            modifyIngredientsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(modifyIngredientsLayout.createSequentialGroup()
                .addGroup(modifyIngredientsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(modifyIngredientsLayout.createSequentialGroup()
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, modifyIngredientsLayout.createSequentialGroup()
                        .addComponent(Update, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(144, 144, 144)))
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        modifyIngredientsLayout.setVerticalGroup(
            modifyIngredientsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(modifyIngredientsLayout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(modifyIngredientsLayout.createSequentialGroup()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29)
                .addComponent(Update)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        managerTab.addTab("Modify Ingredients", modifyIngredients);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(employeeNameLbl)
                .addGap(18, 18, 18)
                .addComponent(employeeName, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(employeeIdLbl)
                .addGap(18, 18, 18)
                .addComponent(employeeId, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(40, 40, 40)
                .addComponent(positionLbl)
                .addGap(18, 18, 18)
                .addComponent(employeePosition, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(21, 21, 21))
            .addComponent(managerTab, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(employeeNameLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(employeeIdLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(positionLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(employeeName, javax.swing.GroupLayout.DEFAULT_SIZE, 19, Short.MAX_VALUE)
                    .addComponent(employeePosition, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(employeeId, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(managerTab, javax.swing.GroupLayout.PREFERRED_SIZE, 374, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        employeeName.getAccessibleContext().setAccessibleName("employeeName");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // HR Management Tab Button Method
    
    private void remove1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_remove1ActionPerformed
        // TODO add your handling code here:   
        Dish d = (Dish)getSelectedObject(jTable4, dishList1);
        dishList.remove(d);
        dishList1.remove(d);
        JOptionPane.showMessageDialog(null, "Dish delete!"); 
        refreshTable(jTable4,dishList1);        
    }//GEN-LAST:event_remove1ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        String name = ingredientName.getText();
        int q = Integer.parseInt(ingredientQuantity.getText());
        int t = Integer.parseInt(threshold.getText());
        Ingredient in = new Ingredient(q,name); 
        in.setThreshold(t);
        fos.getIngredientList().add(in);
        showAllIngredient();
        JOptionPane.showMessageDialog(null, "Ingredient added successfully");
    }//GEN-LAST:event_jButton1ActionPerformed

    private void detailButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_detailButtonActionPerformed
        // TODO add your handling code here:
        Employee e = (Employee)getSelectedObject(jTable2,empList1);
        EmployeeInfoUpdateGUI euf = new EmployeeInfoUpdateGUI(e,fos,this);
        euf.setVisible(true);        
    }//GEN-LAST:event_detailButtonActionPerformed
      
    private void searchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButtonActionPerformed
        // TODO add your handling code here:
        clearTable(jTable2);
        empList1.clear(); 
        if(empIdInput.getText().isEmpty()){
            showAllEmployee();
        }
        else{
        Employee empSearch;
        empSearch = fos.searchEmployee(Integer.parseInt(empIdInput.getText()));
        if(empSearch == null) {
                JOptionPane.showMessageDialog(null, "Employee not found!");
                empIdInput.setText("");
                showAllEmployee();
            } 
         else {               
                position = jTable2.getColumnModel().getColumn(2);  
                JComboBox comboBox = new JComboBox();
                comboBox.addItem("Cook");
                comboBox.addItem("Front Desk");
                comboBox.addItem("Delivery Man");
                comboBox.addItem("Manager"); 
                position.setCellEditor(new DefaultCellEditor(comboBox));                  
                int id = empSearch.getEmployeeId();
                String name = empSearch.getName();
                String p = empSearch.getPosition();            
//                jTable2.setValueAt(id, 0, 0);
//                jTable2.setValueAt(name, 0, 1);
//                jTable2.setValueAt(p, 0, 2);                
                empList1.add(empSearch);  
                refreshTable(jTable2,empList1);
        }
        }
    }//GEN-LAST:event_searchButtonActionPerformed

    private void Change2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Change2ActionPerformed
        // TODO add your handling code here:
        for(int i = 0; i < empList1.size(); i++){     
        String p2 = jTable2.getValueAt(i, 2).toString();        
        empList1.get(i).setPosition(p2);
        
        }  
        JOptionPane.showMessageDialog(null, "Successfully Updated!");
    }//GEN-LAST:event_Change2ActionPerformed
   
    private void removeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeActionPerformed
        // TODO add your handling code here:  
        
        Employee e = (Employee)getSelectedObject(jTable2, empList1);
        empList.remove(e);
        empList1.remove(e);
        JOptionPane.showMessageDialog(null, "Employee delete!"); 
        refreshTable(jTable2,empList1);
    }//GEN-LAST:event_removeActionPerformed

    private void addEmployeeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addEmployeeActionPerformed
        // TODO add your handling code here:
        EmployeeInfoGUI empInfo = new EmployeeInfoGUI(fos, this);
        empInfo.setVisible(true);
    }//GEN-LAST:event_addEmployeeActionPerformed

    //General Methods
    
    @Override
    public void dispose() {  
         int result=JOptionPane.showConfirmDialog(null, "Are you sure to Save and Close?");
         if(result==JOptionPane.YES_OPTION){try {
             fos.saveSystem(fos);
             } catch (IOException ex) {
                 Logger.getLogger(ManagerGUI.class.getName()).log(Level.SEVERE, null, ex);
             }
         super.dispose();
            System.exit(0);
         }
         else if(result==JOptionPane.NO_OPTION){super.dispose();}
         
         else{}
         //To change body of generated methods, choose Tools | Templates.
    }                        
  
    private void managerTabStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_managerTabStateChanged
        // TODO add your handling code here:
        JTabbedPane sourceTabbedPane = (JTabbedPane) evt.getSource();
        int index = sourceTabbedPane.getSelectedIndex();
        if(index == 0){
           showAllEmployee(); 
        }
        else if(index == 1){
            showAllCoupon();
        }
        else if (index == 2){
            showAllDish();
        }
        else {
            showAllIngredient();
        }
    }//GEN-LAST:event_managerTabStateChanged

   // AddCoupon Tab Methods
    
    private void addCouponActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addCouponActionPerformed
        // TODO add your handling code here:
        CouponInfoGUI couponGUI = new CouponInfoGUI(fos, this);
        couponGUI.setVisible(true);
    }//GEN-LAST:event_addCouponActionPerformed
    
    // ModifyMenu Tab Methods
    
    private void searchButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchButton1ActionPerformed
        // TODO add your handling code here:
        if(dishNameInput.getText().isEmpty()){
            showAllDish();
        }
        else{
            Dish searchDish = fos.searchDish(dishNameInput.getText());
            if(searchDish == null) {
                JOptionPane.showMessageDialog(null, "Dish not found!");
                dishNameInput.setText("");
                showAllDish();
            }
            else{
                clearTable(jTable4);
                dishList1.clear();
                int id = searchDish.getDishId();
                String name = searchDish.getName();
                double price = searchDish.readPrice();
                dishList1.add(searchDish);  
                refreshTable(jTable4,dishList1);           
            }
        }
    }//GEN-LAST:event_searchButton1ActionPerformed

    private void detailButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_detailButton1ActionPerformed
        // TODO add your handling code here:
        Dish d = (Dish)getSelectedObject(jTable4,dishList1);
        DishInfoGUI dif = new DishInfoGUI(fos,d,this);
        dif.setVisible(true);
    }//GEN-LAST:event_detailButton1ActionPerformed

    private void addDishActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addDishActionPerformed
        // TODO add your handling code here:
        DishInfoGUI dif = new DishInfoGUI(fos,this);
        dif.setVisible(true);
    }//GEN-LAST:event_addDishActionPerformed

    private void UpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UpdateActionPerformed
        // TODO add your handling code here:
        for(int i = 0; i < ingList.size(); i++){     
        int quantity = Integer.parseInt(jTable5.getValueAt(i, 2).toString());        
        ingList.get(i).setQuantity(quantity);
        }  
        JOptionPane.showMessageDialog(null, "Successfully Updated!");
    }//GEN-LAST:event_UpdateActionPerformed

    private void empIdInputActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_empIdInputActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_empIdInputActionPerformed


       
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ManagerGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ManagerGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ManagerGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ManagerGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ManagerGUI().setVisible(true);
            }
        });
    }

    public JTable getjTable2() {
        return jTable2;
    }

    public LinkedList<Employee> getEmpList1() {
        return empList1;
    }

    public JTable getjTable4() {
        return jTable4;
    }

    public LinkedList<Dish> getDishList1() {
        return dishList1;
    }
    
    
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Change2;
    private javax.swing.JButton Update;
    private javax.swing.JButton addCoupon;
    private javax.swing.JPanel addCouponTab;
    private javax.swing.JButton addDish;
    private javax.swing.JButton addEmployee;
    private javax.swing.JButton detailButton;
    private javax.swing.JButton detailButton1;
    private javax.swing.JTextField dishNameInput;
    private javax.swing.JTextField empIdInput;
    private javax.swing.JLabel employeeId;
    private javax.swing.JLabel employeeIdLbl;
    private javax.swing.JLabel employeeIdLbl1;
    private javax.swing.JLabel employeeName;
    private javax.swing.JLabel employeeNameLbl;
    private javax.swing.JLabel employeePosition;
    private javax.swing.JPanel hRManagementTab;
    private javax.swing.JTextField ingredientName;
    private javax.swing.JTextField ingredientQuantity;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTable jTable4;
    private javax.swing.JTable jTable5;
    private javax.swing.JTabbedPane managerTab;
    private javax.swing.JPanel modifyIngredients;
    private javax.swing.JPanel modifyMenuTab;
    private javax.swing.JLabel positionLbl;
    private javax.swing.JButton remove;
    private javax.swing.JButton remove1;
    private javax.swing.JButton searchButton;
    private javax.swing.JButton searchButton1;
    private javax.swing.JTextField threshold;
    // End of variables declaration//GEN-END:variables
    private javax.swing.table.TableColumn position; 
    private FoodOrderingSystem fos;
    private Employee emp;    
    private LinkedList<Employee> empList;
    private LinkedList<Employee> empList1 = new LinkedList<Employee>();
    private LinkedList<Coupon> cpList;
    private LinkedList<Dish> dishList;
    private LinkedList<Dish> dishList1 = new LinkedList<Dish>();
    private LinkedList<Ingredient> ingList;
    

}
